package com.platform.util;

import java.util.HashMap;
import java.util.Map;

import com.platform.entity.SysUserEntity;
import com.platform.service.SysUserService;
import com.platform.utils.SpringContextUtils;

public class SysUserUtil {
    private static SysUserService sysUserService;

    /**
     * 系统参数
     */
    private static Map<String,String> sysUserIdNameMap;
    
    static {
    	SysUserUtil.sysUserService = (SysUserService) SpringContextUtils.getBean("sysUserService");
    	sysUserIdNameMap = new HashMap<String,String>();
    }
    
    public static String getUserName(String id) {
    	if(sysUserIdNameMap.get(id) == null) {
    		SysUserEntity sysUser = sysUserService.queryObject(Long.valueOf(id));
    		sysUserIdNameMap.put(id, sysUser.getName());
    	}
    	return sysUserIdNameMap.get(id);
    }
}
